<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo isset($admin_title)?$admin_title:"";?>-<?php echo isset($site_name)?$site_name:"";?></title>
<meta name="author" content="designer:webzhu, date:2012-03-23" />
<link type="image/x-icon" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>" rel="icon">
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/base.css"));?>" />
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/admin.css"));?>" />
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/font_icon.css"));?>" />
<?php echo JS::import('jquery');?>
<script type="text/javascript" src="<?php echo urldecode(Url::urlFormat("@static/js/common.js"));?>"></script>
<!--[if lte IE 7]><script src="<?php echo urldecode(Url::urlFormat("@static/css/fonts/lte-ie7.js"));?>"></script><![endif]-->
</head>
<body >
<div id="header">
	<div class="nav_sub">
			    	您好[<?php echo isset($manager['name'])?$manager['name']:"";?>]&nbsp; | <a href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>" target="_blank">返回前台</a> | <a href="<?php echo urldecode(Url::urlFormat("/admin/logout"));?>">退出</a>&nbsp; | &nbsp; <a id="btn_clear" href="javascript:;">清理缓存</a>
	</div>
    <div id="Logo"><a href=""><img src="<?php echo urldecode(Url::urlFormat("@static/images/logo_min.png"));?>"></a></div>
	<ul id="main_nav" class="clearfix">
	<?php foreach($mainMenu as $key => $item){?>
		<li <?php if($key==$menu_index['menu']){?>class="active"<?php }?>><a href="<?php echo urldecode(Url::urlFormat("$item[link]"));?>"  ><?php echo isset($item['name'])?$item['name']:"";?></a></li>
	<?php }?>
	</ul>
</div>
<div id="mainContent">
	<div id="sidebar" >
		<ul class="menu" style="margin-top:15px;">
		<?php foreach($subMenu as $key => $item){?>
			<li class="submenu">
			<ul><li class="sub-index"><b><a href="javascript:;"><?php echo isset($item['name'])?$item['name']:"";?></a></b></li>
			<?php foreach($menu->getNodes($item['link']) as $key => $item){?>
			<?php if(substr($item['link'],-5)!='_edit' && !$item['hidden'] ){?>
				<li><a href='<?php echo urldecode(Url::urlFormat("$item[link]"));?>' <?php if($item['link']==$nav_link){?>class="current"<?php }?> ><?php echo isset($item['name'])?$item['name']:"";?></a></li>
				<?php }?>
			<?php }?>
			</ul>
			</li>
		<?php }?>
		</ul>
	</div>
	<div id="content" >

		<?php if(!isset($msg)){?><?php $msg=Req::post('msg');?><?php }?>
		<?php if(!isset($validator)){?><?php $validator=Req::post('validator');?><?php }?>
		<?php if(isset($msg[0])){?>
		<div id="message-bar" class="message_<?php echo isset($msg[0])?$msg[0]:"";?>"><?php echo isset($msg[1])?$msg[1]:"";?></div>
		<?php }elseif(isset($validator)){?>
		<div class="message_warning"><?php echo isset($validator['msg'])?$validator['msg']:"";?></div>
		<?php }?>
		<?php echo JS::import('dialog?skin=brief');?>
<?php echo JS::import('dialogtools');?>
<?php echo JS::import('form');?>
<form action="" method="post">
    <div class="tools_bar clearfix">
        <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)"
           title="全选" data="true"> 全选 </a>
        <a class="icon-delicious" href="<?php echo urldecode(Url::urlFormat("/customer/recharge_list"));?>"> 全部记录</a>
        <!--<a style="color:red;" href="<?php echo urldecode(Url::urlFormat("/customer/download_recharge_execl_file"));?>">导出充值扣款记录</a>-->
        <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style=""> 筛选条件</a><input
                id="condition_input" type="hidden" name="condition" value="<?php echo isset($condition)?$condition:"";?>"></span>
    </div>
    充值总金额：<b style="color:red;"><?php echo isset($total_1)?$total_1:"";?></b>&nbsp;&nbsp;&nbsp; 扣款总金额：<b style="color:red;"><?php echo isset($total_2)?$total_2:"";?></b>
    <table class="default">
        <tr>
            <th>操作</th>
            <th>用户</th>
            <th>金额</th>
            <th>操作类型</th>
            <th>账户类型</th>
            <th>时间</th>
            <th>操作人</th>

        </tr>
        <?php $item=null; $obj = new Query("recharge as wd");$obj->fields = "wd.*,us.name as uname";$obj->join = "inner join user as us on wd.user_id = us.id";$obj->key = "$i";$obj->where = "$where";$obj->page = "1";$obj->order = "id desc";$obj->pagesize = "20";$items = $obj->find(); foreach($items as $i => $item){?>
        <tr>
            <td style="width:70px" class="btn_min"><?php echo $i+1;?></td>
            <td><?php echo isset($item['uname'])?$item['uname']:"";?></td>
            <td <?php if($item[
            'type']==0){?>class="green"<?php }else{?>class="red"<?php }?>><?php echo isset($item['je'])?$item['je']:"";?></td>
            <td>
                <?php if($item['type']==0){?>
                <b class="green">充值</b>
                <?php }elseif($item['type']==1){?>
                <b class="red">扣款</b>
                <?php }?>
            </td>
            <td>
                <?php echo Common::get_account_name($item['account_type']);?>
            </td>
            <td><?php echo isset($item['create_time'])?$item['create_time']:"";?></td>
            <td><?php echo isset($item['admin'])?$item['admin']:"";?></td>

        </tr>
        <?php }?>
    </table>
</form>
<div class="page_nav">
    <?php echo $obj->pageBar();?>
</div>
<script type="text/javascript">
    var form = new Form();
    $("#condition").on("click", function () {
        $("body").Condition({
            input: "#condition_input", okVal: '高级搜索', callback: function (data) {
                tools_submit({action: '<?php echo urldecode(Url::urlFormat("/customer/recharge_list"));?>', method: 'get'});
            }, data: {
                'us.name': {name: '用户名'},
//                'wd.name': {name: '账户名'},
//                'type_name': {name: '名称'},
//                account: {name: '账号'},
//                amount: {name: '提现金额'},
//                'wd.status': {name: '状态', values: {2: '失败', 0: '待处理', 1: '成功'}}
                 'wd.je': {name: '金额'},
                'wd.type': {name: '操作类型', values: {0:'充值',1:'扣款'}},
                'wd.admin': {name:'操作人'}
            }
        });
    });
    function withdrawAction(id) {
        art.dialog.open("<?php echo urldecode(Url::urlFormat("/customer/withdraw_view/id/"));?>" + id, {id: 'withdraw-dialog', title: "审批", width: 620});
    }
    function close_dialog() {
        art.dialog({id: "withdraw-dialog"}).close();
        tools_reload();
    }
</script>

	</div>
</div>
<script type="text/javascript">
	$(function () {
		if('<?php echo Req::args("con");?>'=='admin'){
			$(".submenu .current").parent().parent().parent().addClass('current');
		}else{
			$(".submenu").addClass('current');
		}
		$(".submenu .sub-index").on("click",function(){
			$(this).parent().parent().toggleClass('current');
		})
	})

</script>
</body>
</html>
<script>
	$("#btn_clear").on("click",function(){
		$.post("<?php echo urldecode(Url::urlFormat("/admin/clear_act"));?>",function(data){
			art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>");
		},'json');
	});
</script>
<!--Powered by TinyRise-->